Skip to content

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Oct 2, 2025

This PR resolves the following stack traces which appear in the last librarian generate job

Traceback (most recent call last):
  File "/app/./cli.py", line 532, in handle_generate
    _generate_api(api_path, library_id, source, output, version)
  File "/app/./cli.py", line 764, in _generate_api
    py_gapic_config = _read_bazel_build_py_rule(api_path, source)
  File "/app/./cli.py", line 556, in _read_bazel_build_py_rule
    result = parse_googleapis_content.parse_content(content)
  File "/app/parse_googleapis_content.py", line 149, in parse_content
    sl.eval(mod, ast, glb, sl.FileLoader(load))
starlark.StarlarkError: error: Variable `proto_library` not found
  --> BUILD.bazel:28:1
   |
28 | proto_library(
   | ^^^^^^^^^^^^^
   |


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/./cli.py", line 1412, in <module>
    args.func(
  File "/app/./cli.py", line 538, in handle_generate
    raise ValueError("Generation failed.") from e
ValueError: Generation failed.
time=2025-10-02T11:28:44.666Z level=INFO msg="=== Docker end ================================================================="
time=2025-10-02T11:28:44.667Z level=ERROR msg="failed to generate library" id=google-cloud-source-context err="exit status 1"
Traceback (most recent call last):
  File "/app/./cli.py", line 532, in handle_generate
    _generate_api(api_path, library_id, source, output, version)
  File "/app/./cli.py", line 764, in _generate_api
    py_gapic_config = _read_bazel_build_py_rule(api_path, source)
  File "/app/./cli.py", line 556, in _read_bazel_build_py_rule
    result = parse_googleapis_content.parse_content(content)
  File "/app/parse_googleapis_content.py", line 149, in parse_content
    sl.eval(mod, ast, glb, sl.FileLoader(load))
starlark.StarlarkError: error: Variable `py_test` not found
   --> BUILD.bazel:188:1
    |
188 | py_test(
    | ^^^^^^^
    |


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/./cli.py", line 1412, in <module>
    args.func(
  File "/app/./cli.py", line 538, in handle_generate
    raise ValueError("Generation failed.") from e
ValueError: Generation failed.
time=2025-10-02T12:32:33.921Z level=INFO msg="=== Docker end ================================================================="
time=2025-10-02T12:32:33.921Z level=ERROR msg="failed to generate library" id=google-cloud-recommendations-ai err="exit status 1"

@parthea parthea requested review from a team as code owners October 2, 2025 17:14
@parthea parthea requested a review from meltsufin October 2, 2025 17:14
@parthea parthea changed the title chore(librarian): fix proto_library not found error chore(librarian): fix proto_library/py_test not found error Oct 2, 2025
@parthea parthea force-pushed the fix-proto-library-not-found branch from 9f14e3e to 7d7d19b Compare October 2, 2025 17:22
@ohmayr ohmayr merged commit 0957535 into main Oct 2, 2025
26 checks passed
@ohmayr ohmayr deleted the fix-proto-library-not-found branch October 2, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants